// https://leetcode.cn/problems/divide-array-into-equal-pairs/description/


func divideArray(nums []int) bool {
    var rec [500]int
    ans := 0
    for i := 0; i < len(rec); ++i {
        if rec[nums[i]] == 0 {
            rec[nums[i]] += 1
        }
        else {
            ans += 1
            rec[nums[i]] -= 1
        }
    }
    for i := 0;i < 500; i++ {
        if rec[i] == 1{
            return False
        }
    }
    return True
}